package models

import "time"

// Role 角色表
type Role struct {
	Id          int32     `gorm:"column:id;type:int;not null;primaryKey;autoIncrement;comment:业务ID" json:"id" form:"id"`
	RoleName    string    `gorm:"column:role_name;type:varchar(20);comment:权限名称" json:"roleName" form:"roleName"`
	RoleCode    string    `gorm:"column:role_code;type:varchar(20);uniqueIndex;comment:权限标识" json:"roleCode" form:"roleCode"`
	MenuIds     string    `gorm:"column:menu_ids;type:text;comment:关联的菜单ID" json:"menuIds" form:"menuIds"`
	IndexMenu   string    `gorm:"column:index_menu;type:varchar(20);comment:首页菜单" json:"indexMenu" form:"indexMenu"`
	Description string    `gorm:"column:description;type:varchar(100);comment:备注" json:"description" form:"description"`
	Enabled     bool      `gorm:"column:enabled;type:tinyint" comment:"1启用 2 停用" json:"enabled" form:"enabled"`
	UpdateUid   int64     `gorm:"column:update_uid;type:bigint;comment:更新用户" json:"updateUid" form:"updateUid"`
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime;default:CURRENT_TIMESTAMP;not null;comment:创建时间" json:"createdAt" form:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:updated_at;type:datetime;default:CURRENT_TIMESTAMP;not null;comment:更新时间" json:"updatedAt" form:"updatedAt"`
}
